import { Entity, Column, PrimaryGeneratedColumn, ManyToOne, OneToMany, BaseEntity, JoinColumn } from 'typeorm';
import { Tags } from '../tags/tags.entity';
import { Video } from '../video/video.entity';

@Entity('video_tag')
export class VideoTag extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'video_id' })
  video_id: number;

  @Column({ name: 'tag_id' })
  tag_id: number;

  @Column({ name: 'user_id' })
  user_id: number;

  @Column({ name: 'create_time' })
  create_time: Date;
  
  @ManyToOne(() => Video, (autherinfo) => autherinfo.video_tag)
  video_: Video[];

}
